import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:logger/logger.dart';
import 'package:mybase/base/tool/entitylog/MyLog.dart';
import 'package:mybase/base/tool/file/FFile.dart';
import 'package:mybase/base/tool/platformUtils/FFPlatform.dart';
import 'package:mybase/base/tool/time/FFTime.dart';

class FFLog {
  static String start = "\u001b";
  static String end = "\u001b[0m";

  static String reset = "\x1B[0m";

  static Logger logger = Logger();

  static test(String text) {}

  ///警告
  static warn(String text) {
    Mylog.w(text);
  }

  ///一般的日志
  static info(String text) {
    Mylog.d(text);
  }

  ///错误
  static error(String text) {
    Mylog.e(text);
  }

  ///成功
  static success(String text) {
    Mylog.i(text);
  }

  ///依结果来定
  static result(bool finish, String text) {
    if (finish) {
      success(text);
    } else {
      error(text);
    }
  }
}

log_warn(String text) {
  FFLog.warn("log_warn:" + text);
}

log_info(String text) {
  FFLog.info("log_info:" + text);
}

log_error(String text) {
  FFLog.error("log_error:" + text);
}

log_success(String text) {
  FFLog.success("log_success:" + text);
}